package cc.vicp.djx314.starfood.domain.dish;

import java.io.Serializable;
import java.sql.Time;

/**
 * 这个类是把List<ProvideTime>里面时间相同的相连的日期连接起来给前台显示
 * @author 水山清风
 *
 */
public class SeriesDishProvideTime implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 7183501740454394984L;
	//~属性=====================================================================
	/**
	 * java实现的自增主键
	 */
	private Integer id;
	/**
	 * 连接以后显示星期几的字符串
	 */
	private String daysOfWeek;
	/**
	 * 一个时间段开始供应该菜式的时间
	 */
	private Time startTime;
	/**
	 * 一个时间段结束供应该菜式的时间
	 */
	private Time endTime;

	//~构造函数=====================================================================
	/**
	 * 默认构造函数
	 */
	public SeriesDishProvideTime() {
	}

	public SeriesDishProvideTime(String daysOfWeek, Time startTime, Time endTime) {
		super();
		this.daysOfWeek = daysOfWeek;
		this.startTime = startTime;
		this.endTime = endTime;
	}

	public SeriesDishProvideTime(Integer id, String daysOfWeek, Time startTime,
			Time endTime) {
		super();
		this.id = id;
		this.daysOfWeek = daysOfWeek;
		this.startTime = startTime;
		this.endTime = endTime;
	}

	//~方法=====================================================================
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SeriesDishProvideTime other = (SeriesDishProvideTime) obj;
		if (daysOfWeek == null) {
			if (other.daysOfWeek != null)
				return false;
		} else if (!daysOfWeek.equals(other.daysOfWeek))
			return false;
		if (endTime == null) {
			if (other.endTime != null)
				return false;
		} else if (!endTime.equals(other.endTime))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (startTime == null) {
			if (other.startTime != null)
				return false;
		} else if (!startTime.equals(other.startTime))
			return false;
		return true;
	}

	//~getter和setter=====================================================================
	/**
	 * 获得id
	 * @return
	 */
	public Integer getId() {
		return id;
	}
	/**
	 * 设置id
	 * @param id
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	/**
	 * 获得daysOfWeek
	 * @return
	 */
	public String getDaysOfWeek() {
		return daysOfWeek;
	}
	/**
	 * 设置daysOfWeek
	 * @param daysOfWeek
	 */
	public void setDaysOfWeek(String daysOfWeek) {
		this.daysOfWeek = daysOfWeek;
	}
	/**
	 * 获得startTime
	 * @return
	 */
	public Time getStartTime() {
		return startTime;
	}
	/**
	 * 设置startTime
	 * @param startTime
	 */
	public void setStartTime(Time startTime) {
		this.startTime = startTime;
	}
	/**
	 * 获得endTime
	 * @return
	 */
	public Time getEndTime() {
		return endTime;
	}
	/**
	 * 设置endTime
	 * @param endTime
	 */
	public void setEndTime(Time endTime) {
		this.endTime = endTime;
	}
}